#include <bits/stdc++.h>
using namespace std;
void permutation(char* pstr,char* pbegin)
{
    if(*pbegin == '\0')
        cout<<pstr<<"\n";
    else{
        for(char* pch = pbegin;*pch != '\0';++pch)
        {
            char temp_a = *pbegin;
            char temp_b = *pch;
            swap(*pbegin,*pch);
            permutation(pstr,pbegin+1);
            swap(*pbegin,*pch);
        }
    }
}
void permutation(char* pstr)
{
    if(pstr == nullptr)
        return;
    permutation(pstr,pstr);
}

int main() {
    char a[] = "abc";
    permutation(a);
    return 0;
}
